﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace ThreadTest
{
    class CommonTimer
    {
        private int count;
        public bool IsExcute = true;

        public int Count
        {
            get { return count; }
            set
            {
                count = value;
                this.OnCountChange(value);
            }
        }

        public delegate void CountChange(int count);
        public event CountChange OnCountChange;

        public void DoWord()
        {
            while (IsExcute)
            {
                Thread.Sleep(1000);
                Count++;
            }
        }

    }
}
